<?php

class Application_Model_MessageBox{

    static function  getMessages(){
        $mess = new Zend_Session_Namespace('messages');
        return $mess->messages;
    }

    static function  clearMessages(){
        $mess = new Zend_Session_Namespace('messages');
        $mess->unsetAll();
    }

    static function  setMessage($var){
        $mess = new Zend_Session_Namespace('messages');
        $temp = $mess->messages;
        if(!$temp) $temp = array();
        $mess->messages = array();

        array_push($temp, $var);
        $mess->messages = array_unique($temp);
    }
}